package com.log;

import org.slf4j.Logger;

/**
 *  全局日志工厂
 */
public class LoggerFactory {

    private static final String SERVER_ERROR = "serverError";

    private static final String WEBSOCKET="webSocket";
    //订单日志
    private static  final  String  ORDERLOG="orderLog";


    //支付日志
    private  static final String  PAYMENTLOG="paymentLog";


    //支付异常日志
    private static final String  PAYMENT_ERROR_LOG="paymentErrorLog";
   //支付宝撤销交易日志
    private static final String  ALIPAY_TRADE_CANCEL_LOG="aliPayTradeCancelLog";

    //发送点对点消息的日志
    private static final String P2P_SEND_PAYRESULT_TO_APP= "p2pSendPayResultToAppclientLog";


    public static Logger getServerErrorLogger(Class<?> clazz) {
        return org.slf4j.LoggerFactory.getLogger(SERVER_ERROR);
    }

    public static Logger getWebSocketLogger(Class<?> clazz){
        return org.slf4j.LoggerFactory.getLogger(WEBSOCKET);
    }

    public static Logger getOrderLogger(Class<?> clazz){
        return org.slf4j.LoggerFactory.getLogger(ORDERLOG);
    }

    public static Logger getPaymentLogger(Class<?> clazz){
        return org.slf4j.LoggerFactory.getLogger(PAYMENTLOG);
    }

    //PAYMENT_ERROR_LOG

    /**
     * 该日志主要用于记录支付宝以及微信的回调
     * @param clazz
     * @return
     */
    public static Logger getP2PSendPayResultToAppclientLogger(Class<?> clazz){
        return org.slf4j.LoggerFactory.getLogger(P2P_SEND_PAYRESULT_TO_APP);
    }

    public static Logger getPaymentErrorLogger(Class<?> clazz){
        return org.slf4j.LoggerFactory.getLogger(PAYMENT_ERROR_LOG);
    }


    public static Logger getAliPayTradeCancelLog(Class<?> clazz){
        return org.slf4j.LoggerFactory.getLogger(ALIPAY_TRADE_CANCEL_LOG);
    }
}
